import request from '@/utils/request'
const BASEURL = '/admin/v1'
const BASEAPIURL = '/api/v1'
// 用户管理-api
export function userIndexApi(query) {
  return request({
    url: BASEURL + '/frontuser',
    method: 'get',
    params: query
  })
}
// 商品列表-api
export function goodsIndexApi(query) {
  return request({
    url: BASEURL + '/product',
    method: 'get',
    params: query
  })
}

// 用户归属营业点-api
export function outletUserApi(query) {
  return request({
    url: BASEURL + '/outlet/user',
    method: 'get',
    params: query
  })
}

// 商品编辑之状态api
export function editProductApi(params, row) {
  if (typeof (row.product_id) === 'undefined') {
    var url = BASEURL + '/product-edit'
  } else {
    url = BASEURL + '/product/space-edit'
  }
  return request({
    url: url,
    method: 'post',
    data: params
  })
}

// 商品删除api
export function delProductApi(params, row) {
  if (typeof (row.product_id) === 'undefined') {
    var url = BASEURL + '/product-delete'
  } else {
    url = BASEURL + '/product/space-delete'
  }
  return request({
    url: url,
    method: 'post',
    data: params
  })
}

// 用户归属列别-api
export function categoryApi(query) {
  return request({
    url: BASEURL + '/categorys',
    method: 'get',
    params: query
  })
}

// 公共总类别表(分配)
export function commCategoryApi(query) {
  return request({
    url: BASEURL + '/category/common',
    method: 'get',
    params: query
  })
}

// 用户归属列别修改/添加-api
export function editCategoryApi(params) {
  return request({
    url: BASEURL + '/category-edit',
    method: 'post',
    data: params
  })
}

// 用户归属列别分配-api
export function allotCategoryApi(params) {
  return request({
    url: BASEURL + '/category/allot',
    method: 'post',
    data: params
  })
}

// 用户归属列别删除 - api
export function delCategoryApi(params) {
  return request({
    url: BASEURL + '/category-delete',
    method: 'post',
    data: params
  })
}

// 图片获取接口-api
export function imgListApi(query) {
  return request({
    url: BASEURL + '/images',
    method: 'get',
    params: query
  })
}

// 用户订单列表 - api
export function orderApi(query) {
  return request({
    url: BASEURL + '/orders',
    method: 'get',
    params: query
  })
}

// 订单接单操作- api
export function disposeApi(params) {
  return request({
    url: BASEURL + '/orders/dispose',
    method: 'post',
    data: params
  })
}

// 订单编辑操作- api
export function editOrderApi(params) {
  return request({
    url: BASEURL + '/orders-edit',
    method: 'post',
    data: params
  })
}

// 订单删除操作- api
export function delOrderApi(params) {
  return request({
    url: BASEURL + '/orders-delete',
    method: 'post',
    data: params
  })
}

// 后台用户列表 - api
export function adminUserApi(query) {
  return request({
    url: BASEURL + '/user',
    method: 'get',
    params: query
  })
}

// 删除管理员 - api
export function delAdminApi(params) {
  return request({
    url: BASEURL + '/user-delete',
    method: 'post',
    data: params
  })
}

// 权限列表List - api
export function roleListApi(query) {
  return request({
    url: BASEURL + '/roles',
    method: 'get',
    params: query
  })
}

// 选择角色权限列表List - api
export function selectRoleListApi(query) {
  return request({
    url: BASEURL + '/roles/select',
    method: 'get',
    params: query
  })
}

// 选择使用的营业点列表List - api
export function selectOutleApi(query) {
  return request({
    url: BASEURL + '/outlet/select',
    method: 'get',
    params: query
  })
}

// 管理员修改/添加-api
export function editAdminApi(params) {
  return request({
    url: BASEURL + '/user-edit',
    method: 'post',
    data: params
  })
}

// 权限路由树状图-api
export function permissionTreeApi(query) {
  return request({
    url: BASEURL + '/permission',
    method: 'get',
    params: query
  })
}

// 权限路由菜单删除-api
export function delPermissionApi(params) {
  return request({
    url: BASEURL + '/permission-delete',
    method: 'post',
    data: params
  })
}

// 权限路由菜单 编辑 / 新增-api
export function editPermissionApi(params) {
  return request({
    url: BASEURL + '/permission-edit',
    method: 'post',
    data: params
  })
}

// 角色编辑-api
export function editRoleApi(params) {
  return request({
    url: BASEURL + '/roles-edit',
    method: 'post',
    data: params
  })
}

// 角色删除-api
export function deleteRoleApi(params) {
  return request({
    url: BASEURL + '/roles-delete',
    method: 'post',
    data: params
  })
}

// 营业点列表-api
export function hotelListApi(query) {
  return request({
    url: BASEURL + '/outlet',
    method: 'get',
    params: query
  })
}

// 营业点编辑/添加-api
export function editHotelApi(params) {
  return request({
    url: BASEURL + '/outlet-edit',
    method: 'post',
    data: params
  })
}

// 营业点 删除 -api
export function delHotelApi(params) {
  return request({
    url: BASEURL + '/outlet-delete',
    method: 'post',
    data: params
  })
}

// 区域列表 -api
export function areaListApi() {
  return request({
    url: BASEURL + '/areas/list',
    method: 'get'
  })
}

// 管理员列表List - api
export function adminSelectApi(query) {
  return request({
    url: BASEURL + '/user/select',
    method: 'get',
    params: query
  })
}

// 管理员结算配置列表List - api
export function billConfigApi(query) {
  return request({
    url: BASEURL + '/billconfig/courier',
    method: 'get',
    params: query
  })
}

// 加盟商结算配置列表List - api
export function unitBillConfigApi(query) {
  return request({
    url: BASEURL + '/billconfig/outlet',
    method: 'get',
    params: query
  })
}

// 管理员结算配置删除- api 08-05
export function delbillConfigApi(params) {
  return request({
    url: BASEURL + '/billconfig/courier-del',
    method: 'post',
    data: params
  })
}

// 获取单个地区的细信息数据 - api
export function AreaInfoApi(query) {
  return request({
    url: BASEURL + '/areas/info',
    method: 'get',
    params: query
  })
}

// 批量搜索信息数据 - api
export function searchProductApi(query) {
  return request({
    url: BASEURL + '/product/search',
    method: 'get',
    params: query
  })
}

// 批量复制商品数据 -api
export function copyProductApi(params) {
  return request({
    url: BASEURL + '/product/copy',
    method: 'post',
    data: params
  })
}

// 模拟下单品数据 -api
export function paymentProductApi(params) {
  return request({
    url: BASEURL + '/orders/payment',
    method: 'post',
    data: params
  })
}

// 模拟下单品数据 -api
export function editbillconfigApi(params) {
  return request({
    url: BASEURL + '/billconfig/courier-edit',
    method: 'post',
    data: params
  })
}

// 代理经销商归属类型提交数据 -api
export function resellerCategoryApi(params) {
  return request({
    url: BASEURL + '/category/reseller',
    method: 'post',
    data: params
  })
}

// 代理商店的未结算数据 - api
export function resellerReportApi(query) {
  return request({
    url: BASEURL + '/report/reseller',
    method: 'get',
    params: query
  })
}

// 配送员的未结算数据 - api
export function courierReportApi(query) {
  return request({
    url: BASEURL + '/report/courier',
    method: 'get',
    params: query
  })
}

// 配送员的未结算数据个人详情 - api
export function courierReportDetailApi(query) {
  return request({
    url: BASEURL + '/report/courier-detail',
    method: 'get',
    params: query
  })
}

// 商店代理的结算数据个人详情 - api
export function resellerReportDetailApi(query) {
  return request({
    url: BASEURL + '/report/reseller-detail',
    method: 'get',
    params: query
  })
}

// 提现审核列表 - api
export function withrawCheckApi(query) {
  return request({
    url: BASEURL + '/cash/withdraw-check',
    method: 'get',
    params: query
  })
}

// 结算按钮提交 -api 20180831
export function withdrawPayApi(params) {
  return request({
    url: BASEURL + '/cash/withdraw-pay',
    method: 'post',
    data: params
  })
}

// 用户提现详情列表 -api 20180831
export function withdrawDetailApi(query) {
  return request({
    url: BASEURL + '/cash/withdraw-detail',
    method: 'get',
    params: query
  })
}

//  操作结算时需要锁定行 -api 20180831
export function lockAccountApi(params) {
  return request({
    url: BASEURL + '/cash/lock-account',
    method: 'POST',
    data: params
  })
}

//  首页折线图-api 20180831
export function homeLineApi(query) {
  return request({
    url: BASEURL + '/home/chart-index',
    method: 'get',
    params: query
  })
}

//  主要类别显示列表-api 20180923
export function maincategoriesApi(query) {
  return request({
    url: BASEURL + '/category/main',
    method: 'get',
    params: query
  })
}

//  相册管理列表-api 20180925
export function photoListApi(query) {
  return request({
    url: BASEURL + '/images/photo',
    method: 'get',
    params: query
  })
}

//  相册管理删除图片-api 20180831
export function delPhotoApi(params) {
  return request({
    url: BASEURL + '/images/photo-delete',
    method: 'POST',
    data: params
  })
}

//  交际圈首页--信息列表-api 20181003
export function informaListApi(query) {
  return request({
    url: BASEURL + '/social/informa-index',
    method: 'get',
    params: query
  })
}

//  交际圈首页--信息类型列表-api 20181010
export function infoCateSelectApi(query) {
  return request({
    url: BASEURL + '/social/infocate-select',
    method: 'get',
    params: query
  })
}

//  交际圈 删除单个 信息,回复-api 20181010
export function infoDeleteApi(params) {
  return request({
    url: BASEURL + '/social/informa-delete',
    method: 'post',
    data: params
  })
}

//  交际圈回复列表-api 20181010
export function infoReplyApi(query) {
  return request({
    url: BASEURL + '/social/info_reply',
    method: 'get',
    params: query
  })
}

//  交际圈信息类型列表-api 20181010
export function infocateApi(query) {
  return request({
    url: BASEURL + '/social/infocate-index',
    method: 'get',
    params: query
  })
}

//  交际圈信息收费类型列表-api 20181010
export function infoCashTypeApi(query) {
  return request({
    url: BASEURL + '/social/infocash-type',
    method: 'get',
    params: query
  })
}

//  交际圈信息收费类型编辑 费用,状态-api 20181014
export function editInfoCashTypeApi(params) {
  return request({
    url: BASEURL + '/social/cashtype-edit',
    method: 'post',
    data: params
  })
}

//  交际圈信息类型提交-api 20181014
export function editInfocateApi(params) {
  return request({
    url: BASEURL + '/social/infocate-edit',
    method: 'post',
    data: params
  })
}

//  营业点的提现审核列表
export function outletWithdrawApi(query) {
  return request({
    url: BASEURL + '/cash/outlet/withdraw-check',
    method: 'get',
    params: query
  })
}

//  营业点的提现审核详细列表 2019-02-01(未实现)
export function outletWithdrawDetailApi(query) {
  return request({
    url: BASEURL + '/cash/outlet/withdraw-detail',
    method: 'get',
    params: query
  })
}

//  营业点账单列表 2019-02-01
export function outletReportApi(query) {
  return request({
    url: BASEURL + '/report/outlet',
    method: 'get',
    params: query
  })
}

//  加盟店账单详情列表 2019-02-01
export function outletReportDetailApi(query) {
  return request({
    url: BASEURL + '/report/outlet-detail',
    method: 'get',
    params: query
  })
}

// 文件打包下载- api 19-02-18
export function downZipApi(params) {
  return request({
    url: BASEURL + '/outlet/dwoncode',
    method: 'post',
    data: params
  })
}

// 单个状态更改- api 19-03-10
export function stateApi(params) {
  return request({
    url: BASEAPIURL + '/field-state',
    method: 'post',
    data: params
  })
}
// 获取系统配置数据列表- api 19-03-10
export function systemConfigApi(query) {
  return request({
    url: BASEURL + '/setting/voice',
    method: 'get',
    params: query
  })
}

// 获取系统配置数据更改- api 19-03-10
export function postSystemConfigApi(params) {
  return request({
    url: BASEURL + '/setting/voice-handle',
    method: 'post',
    data: params
  })
}

// 获取设备数据列表- api 19-04-23
export function deviceListApi(query) {
  return request({
    url: BASEURL + '/setting/device-list',
    method: 'get',
    params: query
  })
}

// 设备删除 - api
export function delDeviceApi(params) {
  return request({
    url: BASEURL + '/setting/del-device',
    method: 'post',
    data: params
  })
}

// 添加设备 - api
export function addDeviceApi(params) {
  return request({
    url: BASEURL + '/setting/add-device',
    method: 'post',
    data: params
  })
}

// 编辑删除 - api
export function editDeviceApi(params) {
  return request({
    url: BASEURL + '/setting/edit-device',
    method: 'post',
    data: params
  })
}

// 获取站点扫餐码数据列表- api 19-04-23
export function symbolListApi(query) {
  return request({
    url: BASEURL + '/symbol/scan-list',
    method: 'get',
    params: query
  })
}

// 删除扫餐码 - api
export function delSymbolApi(params) {
  return request({
    url: BASEURL + '/symbol/del-scan',
    method: 'post',
    data: params
  })
}

// 编辑扫餐码房间号和状态 - api
export function editSymbolApi(params) {
  return request({
    url: BASEURL + '/symbol/edit-scan',
    method: 'post',
    data: params
  })
}

// 批量选择下载二维码 - api
export function downCheckZipApi(params) {
  return request({
    url: BASEURL + '/down/checkCode',
    method: 'post',
    data: params
  })
}

// 获取设备组数据列表- api 19-05-01
export function deviceGrooupApi(query) {
  return request({
    url: BASEURL + '/device/group-list',
    method: 'get',
    params: query
  })
}

// 获取提供选择设备组数据列表- api 19-05-01
export function selectDeviceGrooupApi(query) {
  return request({
    url: BASEURL + '/device/select-group',
    method: 'get',
    params: query
  })
}

// 添加设备组 - api
export function addDeviceGroupApi(params) {
  return request({
    url: BASEURL + '/device/add-group',
    method: 'post',
    data: params
  })
}

// 修改编辑设备组 - api
export function editDeviceGroupApi(params) {
  return request({
    url: BASEURL + '/device/edit-group',
    method: 'post',
    data: params
  })
}

// 删除设备组 - api
export function delDeviceGroupApi(params) {
  return request({
    url: BASEURL + '/device/del-group',
    method: 'post',
    data: params
  })
}

// 获取条形码商品数据列表- api 19-05-08
export function searchAllProductApi(query) {
  return request({
    url: BASEURL + '/product/searchAll',
    method: 'get',
    params: query
  })
}

// 编辑指定商品的条形码 - api 19-05-08
export function editBarCodeApi(params) {
  return request({
    url: BASEURL + '/product/edit-barcode',
    method: 'post',
    data: params
  })
}
